package com.icepuppet.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PathController {
    //单个路径参数
    @RequestMapping("/path/{id}")
    public String pathParam(@PathVariable Integer id){
        System.out.println(id);
        return "OK";
    }

    //多个路径参数
    @RequestMapping("/path/{id}/{name}")
    public String pathParams(@PathVariable Integer id,@PathVariable String name){
        System.out.println(id + name);
        return "OK";
    }
}
